/**
  * Author: Mei
  * Date: 2020-12-25 9:36
  * Description:
  */
#include "ThreadPool.h"

using namespace std;
std::mutex queue_mutex;

int main() {
    ThreadPool pool(4);
    std::vector<std::future<int>> results;
    for (int i = 0; i < 4; ++i) {
        results.emplace_back(
                pool.enqueue([](int a, int b) {
                    std::unique_ptr<std::mutex> lock(queue_mutex);

                }, 10 + i, 11 + i)
        );
    }
    for (auto &&result : results) {
        cout << result.get() << " ";
    }
    cout << endl;

    return 0;
}